﻿using System;
using Core.BOL;
using Core.DAL;
using Core.Extentions;
using Elmah;

namespace Core.ScheduleTask
{
    public static class AgendaMail
    {
        public static void Proceed()
        {
            try
            {
                using (MailToGenerateRepository mtgr = new MailToGenerateRepository())
                {
                    tMail_ToGenerate mtg = new tMail_ToGenerate();
                    mtg.Action = "Agenda";
                    mtg.InsertDate = DateTime.Now.GetNowTimeByTimeZone();
                    mtg.ItemID = null;
                    mtg.ResourceID = null;
                    mtg.SID = 7;

                    mtgr.InsertMail(mtg);
                    mtgr.Save();
                }
            }
            catch (Exception ex)
            {
                ErrorLog.GetDefault(null).Log(new Error(ex));
            }
        }
    }
}
